package bb.lanxing.lib.kt.model.geo;

import android.os.Parcel;
import android.os.Parcelable;

public class RouteBookGeoPoint implements IGeoPoint {
    public static final Parcelable.Creator<RouteBookGeoPoint> CREATOR = new Parcelable.Creator<RouteBookGeoPoint>() {
        @Override
        public RouteBookGeoPoint createFromParcel(Parcel parcel) {
            return new RouteBookGeoPoint(parcel);
        }

        @Override
        public RouteBookGeoPoint[] newArray(int i) {
            return new RouteBookGeoPoint[i];
        }
    };
    protected double altitude;
    protected double latitude;
    private int lineType;
    protected double longitude;
    protected int type;

    @Override
    public int describeContents() {
        return 0;
    }

    public RouteBookGeoPoint(double d, double d2) {
        this.type = -1;
        this.latitude = d;
        this.longitude = d2;
    }

    public RouteBookGeoPoint(int i, double d, double d2) {
        this.type = i;
        this.latitude = d;
        this.longitude = d2;
    }

    public RouteBookGeoPoint(int i, double d, double d2, int i2) {
        this.type = i;
        this.latitude = d;
        this.longitude = d2;
        this.lineType = i2;
    }

    @Override
    public int getType() {
        return this.type;
    }

    @Override
    public double getLatitude() {
        return this.latitude;
    }

    @Override
    public double getLongitude() {
        return this.longitude;
    }

    @Override
    public void setAltitude(double d) {
        this.altitude = d;
    }

    @Override
    public double getAltitude() {
        return this.altitude;
    }

    @Override
    public IGeoPoint toBaidu() {
        throw new ConvertPointException("method toBaidu() not support for " + getClass());
    }

    @Override
    public IGeoPoint toCommon() {
        throw new ConvertPointException("method toCommon() not support for " + getClass());
    }

    @Override
    public IGeoPoint toEarth() {
        throw new ConvertPointException("method toEarth() not support for " + getClass());
    }

    @Override
    public IGeoPoint toBaidu(boolean z) {
        throw new ConvertPointException("method toBaidu() not support for " + getClass());
    }

    @Override
    public IGeoPoint toCommon(boolean z) {
        throw new ConvertPointException("method toCommon() not support for " + getClass());
    }

    @Override
    public IGeoPoint toEarth(boolean z) {
        throw new ConvertPointException("method toEarth() not support for " + getClass());
    }

    @Override
    public IGeoPoint toType(int i) {
        if (i != 0) {
            if (i != 1) {
                return i != 2 ? this : toBaidu(false);
            }
            return toCommon(false);
        }
        return toEarth(false);
    }

    public class ConvertPointException extends RuntimeException {
        public ConvertPointException() {
        }

        public ConvertPointException(String str) {
            super(str);
        }

        public ConvertPointException(String str, Throwable th) {
            super(str, th);
        }

        public ConvertPointException(Throwable th) {
            super(th);
        }
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeDouble(this.latitude);
        parcel.writeDouble(this.longitude);
    }

    public RouteBookGeoPoint() {
    }

    protected RouteBookGeoPoint(Parcel parcel) {
        this.latitude = parcel.readDouble();
        this.longitude = parcel.readDouble();
    }

    public int getLineType() {
        return this.lineType;
    }

    public void setLineType(int i) {
        this.lineType = i;
    }
}
